<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/static/commons/taglibs.jsp"%>
<%@ include file="/static/commons/meta.jsp"%>
<%@ include file="/static/commons/jquery-easyui.jsp"%>
<html >
	 <head>
 		<title>${title }</title>
 		<link rel="stylesheet" href="${ctx }/static/styles/basic/basic.css" />
		<link rel="stylesheet" href="${ctx }/static/styles/frame/main.css" />
		<link rel="stylesheet" href="${ctx }/static/styles/frame/searchBtn.css" />
		<link rel="stylesheet" href="${ctx }/static/styles/frame/searchCondition.css" />
	    <!-- js -->
 		<script type="text/javascript" src="${ctx}/static/scripts/check_all.js"></script>
 		<script type="text/javascript" src="${ctx}/static/scripts/set_select.js"></script>
 		<script type="text/javascript" src="${ctx}/static/scripts/waiting.js"></script>
 		<script type="text/javascript" src="${ctx}/static/scripts/crud.js"></script>
 		<script type="text/javascript" src="${ctx}/static/scripts/common.js"></script>
 		<script type="text/javascript" src="${ctx}/static/scripts/util.js"></script>
	</head>
  <body onload="init()">
		<form action="${ctx}/sendController/list" method="post">
  			<input type="hidden" name="RequestVerificationToken" value="${RequestVerificationToken}" />
			<div class="width_100 group_box">
				<div class="group_search width_100">
					<vvise:select id="custId" name="p_custId" sqlname="getCust" displayText="用户单位" ifSearch="true"/>
		            <vvise:searchInput id="orderId" name="p_orderId" displayText="订单号" />
			        <div class="clear_both"></div>
				</div>
				<vvise:funMenu menuId="${menuId}" />
			</div>
        </form>
        <div class="listFrame">
        	<iframe name="listFrame" id="listFrame" frameBorder="0"
				scrolling="auto" style="width: 100%;height:100%;"></iframe>
        </div>
	</body>
	<script type="text/javascript">
  		var headers = {};
		headers['__RequestVerificationToken'] = "${RequestVerificationToken}";
			//回车事件
		document.onkeydown = keyKistener;
		function keyKistener(e){
			e = e ? e:event;
			if(e.keyCode == 13){
				try{
					search();
				}catch(e){}
			}
		}
		function init(){
			set_iframe_h();
			$(window).resize(function(){
				set_iframe_h();
			});
			search();
			$('.easyui-combobox').combobox();
		}
		//设置ifream 高度
		function set_iframe_h(){
			var win_height  = $(window).height();
			var func_line_h = $('.group_box').outerHeight(true);
			var list_height = win_height - func_line_h;
			$('.listFrame').css('height',list_height-10);
		}
		
		function search(){
			waiting();
			document.forms[0].target = "listFrame";
			document.forms[0].submit();
		}


        function editSendInfo(orderId){
            var pp = parent;
            pp.openWindow("填写证书邮寄地址",pp.width3,500,"${ctx}/sendController/showEdit?orderId="+orderId,[{
                text:'确认保存',
                iconCls:'icon-ok',
                id:'btn0',
                handler:function(){
                    saveSendInfo();
                }
            },{
                text:'取消',
                iconCls:'icon-no',
                handler:function(){
                    pp.closeWindow();
                }
            }]);
            pp.$('#winDiv #btn1').hide();
        }

        function saveSendInfo(){
            var pp = parent;
            var editFrame = pp.winFrame;
            var flag = editFrame.validForm();


            if(flag) {
                $.ajax({
                    cache: false,
                    type: "POST",
                    headers: headers,
                    url:'${ctx}/sendController/saveSendInfo',
                    data:editFrame.$('#editForm').serialize(),
                    async: false,
                    error: function(request) {
                        pp.$.messager.alert('操作提示',"操作失败！","error");
                    },
                    success: function(data) {
                        if(data && "success" == data){
                            pp.$.messager.alert('操作提示',"保存成功！","info",function(){
                                search();
                                pp.closeWindow();
                            });
                        }
                    }
				});
            }


		}


		
		</script>
</html>